module.exports = (req, res, next) => {
  res.success = (data, message = "成功") => {
    res.json({ code: 200, message, data });
  };
  res.fail = (code = 500, message = "失败") => {
    res.status(code).json({ code, message, data: null });
  };
  next();
};
